Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload coverage report from main directly #125

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

glatterf42
Copy link
Member

While thinking about how to work with Codecov and the squash & merge workflow, I now believe the following workflow should work:

  1. Get coverage report
  2. Upload to Codecov as usual
  3. Upload to Codecov again but with override_branch: main so that the commit also seems to belong to main

Subsequent PRs should then be able to find the reports (but see here for a caveat) and compare to them successfully.

So the first commit on this PR sets up the double uploading. Unfortunately, while thinking about this a bit more, I understood that this workflow won't work for PRs with revisions, so to speak: when the tests run once on a PR and upload its coverage, that coverage would be assumed to be valid for main, too. If you then need to improve your code later one and run the checks again, it would be run against the previously last commit of this PR, essentially rendering the patch checks (usually indicating coverage changes by this PR) meaningless.

Thus, the second commit simply enables the whole workflow on PRs as well as pushes to main, which wastes some computational resources, but seems to be the easiest way on our side.
I'll leave a note, however, to watch the issue linked above and revise our workflow once a better one becomes available.

On that note, why are we running the build-docs workflow on PRs and pushes to main (or at all, since we also let RTD build the docs for every PR)? Our own workflow is slightly faster than RTD, but the pages are not rendered as nicely.

@glatterf42 glatterf42 added the enhancement New feature or request label Oct 22, 2024
@glatterf42 glatterf42 requested a review from meksor October 22, 2024 11:18
@glatterf42 glatterf42 self-assigned this Oct 22, 2024
Copy link
Contributor

@meksor meksor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have no clue whats going on here exactly but it doesnt look like it will break anything...

On that note, why are we running the build-docs workflow on PRs and pushes to main (or at all, since we also let RTD build the docs for every PR)? Our own workflow is slightly faster than RTD, but the pages are not rendered as nicely.

Also no clue, the git blame points to me because I moved the workflow file at some point but i think originally this was added by @danielhuppmann or @phackstock and might also be connected to the old self hosted docs setup?

@glatterf42
Copy link
Member Author

Thanks for the context! I think I'll disable the workflow, then. No need to duplicate building the docs (or else, we could quickly add it back in) and RTD's rendering seems more practical to me.

@glatterf42 glatterf42 merged commit 70366d4 into main Nov 6, 2024
11 checks passed
@glatterf42 glatterf42 deleted the setup/codecov-upload-to-main branch November 6, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants